FIND_PATH(SMARTBODY_ROOT smartbody.html)
FIND_PATH(SMARTBODY_INCLUDE_DIR sb/SBScene.h PATHS ${SMARTBODY_ROOT}/core/smartbody/SmartBody/src)
FIND_PATH(SMARTBODY_PYTHON_INCLUDE_DIR pyconfig.h PATHS ${SMARTBODY_ROOT}/core/smartbody/Python27/include)
FIND_PATH(SMARTBODY_STEERLIB_INCLUDE_DIR SteerLib.h
          PATHS ${SMARTBODY_ROOT}/core/smartbody/steersuite-1.3/steerlib/include)
FIND_PATH(SMARTBODY_STEERLIB_TINYXML_INCLUDE_DIR tinyxml/tinyxml.h
          PATHS ${SMARTBODY_ROOT}/core/smartbody/steersuite-1.3/external)
FIND_PATH(SMARTBODY_BOOST_INCLUDE_DIR boost-build.jam PATHS ${SMARTBODY_ROOT}/lib/boost)
FIND_PATH(SMARTBODY_VHCL_INCLUDE_DIR vhcl.h PATHS ${SMARTBODY_ROOT}/lib/vhcl/include)
FIND_PATH(SMARTBODY_BONEBUS_INCLUDE_DIR bonebus.h PATHS ${SMARTBODY_ROOT}/lib/bonebus/include)
FIND_PATH(SMARTBODY_WSP_INCLUDE_DIR wsp.h PATHS ${SMARTBODY_ROOT}/lib/wsp/wsp/include)

FIND_LIBRARY(SMARTBODY_LIBRARY NAMES SmartBody)
LINK_DIRECTORIES(${SMARTBODY_PYTHON_INCLUDE_DIR}/../libs)
LINK_DIRECTORIES(${SMARTBODY_BOOST_INCLUDE_DIR}/lib)

IF(SMARTBODY_INCLUDE_DIR AND SMARTBODY_LIBRARY)
    SET(EXTERNAL_INCLUDE_DIR 
        ${SMARTBODY_INCLUDE_DIR} ${SMARTBODY_PYTHON_INCLUDE_DIR}
        ${SMARTBODY_STEERLIB_INCLUDE_DIR} ${SMARTBODY_STEERLIB_TINYXML_INCLUDE_DIR}
        ${SMARTBODY_BOOST_INCLUDE_DIR} ${SMARTBODY_VHCL_INCLUDE_DIR} ${SMARTBODY_BONEBUS_INCLUDE_DIR}
        ${SMARTBODY_WSP_INCLUDE_DIR}
    )
    SET(EXTERNAL_LIBRARIES ${SMARTBODY_LIBRARY} ${OPENGL_LIBRARIES})
    
    SET(EXAMPLE_NAME osgsmartbody)
    SET(EXAMPLE_FILES osgsmartbody.cpp)
    START_EXAMPLE()
ENDIF(SMARTBODY_INCLUDE_DIR AND SMARTBODY_LIBRARY)
